#ifndef __FAN_CONTROL_H
#define __FAN_CONTROL_H
#include "allThread.h"


#define FAN_TIMER_STATE_OFF (0)
#define FAN_TIMER_STATE_ON  (1)

#define FSM_STATE_CHANGE_OFF (0)
#define FSM_STATE_CHANGE_ON  (1)

typedef union{
    struct{
    int tempReactor_1C;/*电抗*/
    int tempBuscap_1C;/*母排电容*/
    int tempFiltercap_1C;/*滤波电容*/
    int tempIgbt_1C;/*IGBT*/
    int tempAcCabinet_1C;/*交流柜*/
    }monitPointMaxTemp;
    int monitPoint[5];
}fanCtrlMonitPointType;

typedef struct{
    int prevState;/*风机上一次状态*/
    int currentState;/*风机当前状态(0:停转,80:80%速度转,100:满转)*/
    int nextState;/*风机需要转换成的状态*/
    int fanTimerState;/*定时器状态,定时器启动时置为:FAN_TIMER_STATE_ON,强制启风机*/
}fanStateType;

typedef struct{
    int prevState;/*pcs上一次状态*/
    int currentState;/*pcs当前状态*/
    int StateChangeFlag;/*pcs状态发生变化时置为:FSM_STATE_CHANGE_ON (1)*/
}fsmStateType;

uint16_t FanControl_SpeedGet(void);

void FanControl_Thread(void *pPara);

#endif

